/**
 * Created with IntelliJ IDEA.
 * Description:
 * Date: 2024-01-24
 * Time:20:36
 */
public class insertSort {
    public static void InsertSort(Comparable[] comparables) {
        for(int i = 0;i < comparables.length - 1;i++) {
            int end = i;
            for(int j = end;j >= 0;j--) {
                if(comparables[j].compareTo(comparables[j+1])>0) {
                    Comparable tmp = comparables[j];
                    comparables[j] = comparables[j+1];
                    comparables[j+1] = tmp;
                }
            }
        }
    }
}
